← Back
Editing: index226.js
import{_ as t}from"./index93.js?v=1765440387";import{o as a,R as e,K as s,k as i,b as o}from"./utils-lib.js?v=1765440387";import{$ as n,ar as r,as as c}from"./files.js?v=1765440387";import{an as l,aP as m,aB as p,aQ as d,aR as u,aS as f}from"./store.js?v=1765440387";import{c as h,r as b,aC as y,p as j,q as x,v as _,e as g,A as w,x as k}from"./base-lib.js?v=1765440387";import{u as v}from"./column.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./validator.js?v=1765440387";import"./index94.js?v=1765440387";import"./store2.js?v=1765440387";import"./index91.js?v=1765440387";const q={class:"py-[1rem] px-16px"},N=h({__name:"index",props:{compData:{default:()=>({})}},emits:["close"],setup(h,{expose:N,emit:C}){const D=o(),R=h,T=C,A=b(R.compData.editorTabsActive.history||[]),E=[{label:"版本时间",prop:"time",render:t=>y("span",{},(t=>{const a=new Date(1e3*Number(t));return isNaN(a.getTime())?t:e(a)})(t))},v([{onClick:async t=>{const a={filename:l.path,history:t},e=await s({request:r(a)}),i=m(l.id);e.status?(p.value={id:l.id,st_mtime:t,path:l.path,type:"editor"},T("close"),await d({title:"".concat(l.title," <-> ").concat(l.title),type:"diff",mode:"diff",path:l.path}),await u({mode:"ace/mode/".concat(l.mode),left:{content:e.data.data,editable:!1,copyLinkEnabled:!1},right:{content:i.getValue(),editable:!1,copyLinkEnabled:!1}})):D.request(e)},width:65,title:"文件对比"},{onClick:async t=>{await a({title:"恢复历史文件",content:"是否恢复历史文件 ".concat(e(Number(t)),"?恢复历史文件后,当前文件内容将会被替换!")}),s({loading:"正在恢复历史文件,请稍后...",request:n({filename:l.path,history:t}),message:!0,success:t=>{t.status&&(R.compData.callback(),L())}})},title:"恢复"},{onClick:async t=>{await a({title:"删除历史文件",content:"是否删除历史文件 ".concat(e(Number(t)),"?删除历史文件后,将无法恢复!")}),s({loading:"正在删除历史文件,请稍后...",request:c({filename:l.path||"",history:t}),message:!0,success:t=>{t.status&&L()}})},title:"删除"}])],L=async()=>{try{const{data:t}=await f(l.path);A.value=t.historys}catch(t){}};return j(()=>{L()}),N({}),(a,e)=>{const s=i,o=t;return x(),_("div",q,[g(o,null,{content:w(()=>[g(s,{ref:"fileTableRef",height:"40rem",column:E,description:"列表为空",data:k(A)},null,8,["data"])]),_:1})])}}});export{N as default};
Save File
Cancel